<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <link rel="stylesheet" href="/public/css/user_center.css">
</head>
<body>
    <h1>欢迎来到个人中心</h1>
    
    <div id="user-info">
        <h2>个人信息</h2>
        <p>用户名：<span id="username"></span></p>
        <p>最近登录时间：<span id="last_login_time"></span></p>
        <p>最近登录IP：<span id="last_login_ip"></span></p>

        <input type="text" id="new_username" placeholder="修改用户名">
        <button onclick="updateUsername()">提交修改</button>
    </div>

    <div id="password-change">
        <h2>修改密码</h2>
        <input type="password" id="old_password" placeholder="旧密码"><br>
        <input type="password" id="new_password" placeholder="新密码"><br>
        <input type="password" id="confirm_password" placeholder="确认新密码"><br>
        <button onclick="changePassword()">修改密码</button>
    </div>

    <div id="login-history">
        <h2>登录记录</h2>
        <table border="1">
            <thead>
                <tr>
                    <th>时间</th>
                    <th>IP</th>
                </tr>
            </thead>
            <tbody id="history-table"></tbody>
        </table>
    </div>

    <button onclick="logout()">退出登录</button>

    <script src="/public/js/user_center.js"></script>
</body>
</html>
